import numpy as np

class Solution:
    def uniquePaths(self, m: int, n: int) -> int:
        if m == 1 or n == 1:
            return 1
        ma = np.zeros((m + 1, n + 1), dtype=int)
        ma = ma.tolist()
        ma[1][1] = 1
        for i in range(1, m + 1):
            for j in range(1, n + 1):
                if i == 1 and j == 1:
                    continue
                ma[i][j] = ma[i][j - 1] + ma[i - 1][j]
        return ma[m][n]


# s = Solution()
# res = s.uniquePaths(3, 5)
# print(res)
